home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / galaxy2 / descri~1.bas < prev    next >
BASIC Source File  |  1997-08-06  |  3KB  |  81 lines

  1. Attribute VB_Name = "ProcessRequest"
  2. Option Explicit
  3. Public Function GetInfo(Choice As Long) As String
  4.  
  5. '-------------------------------------------------
  6. 'Module:Description.Bas                 7/25/97
  7. '-------------------------------------------------
  8. 'Author:Burt Abreu
  9. '
  10. 'Purpose:Function recieves choice from
  11. 'lstPlanets_Click event and then processes
  12. 'using a simple Select Case decision structure;
  13. 'returning descriptive text to the txtContent
  14. 'Text property.
  15. '-------------------------------------------------
  16.   
  17. '-------------------------------------------------
  18. 'Create and initialize NewLine variable which will
  19. 'use the ascii values for carriage return and line
  20. 'feed to create the functionality of a <Enter> key
  21. 'on the typewriter. Those of you using VB 5.0 can
  22. 'use the new constant vbCrLf for this.
  23. '-------------------------------------------------
  24.   Dim NewLine As String
  25.   NewLine = Chr(13) + Chr(10)
  26.   
  27.   Select Case Choice
  28.     Case 0 ' "asteroid"
  29.     '--------------------------------------------
  30.     'Process users combo box selection and assign
  31.     'appropriate text to txtContent Text property
  32.     'using a nested Select Case Statement.
  33.     '--------------------------------------------
  34.        
  35.          Select Case Form1.cboSelectText.ListIndex
  36.            Case 0
  37.             '
  38.             ' *** The return string of the function will be the text
  39.             '     for the list box
  40.             GetInfo = "Here you can write some interesting" _
  41.             & " general information about asteroids that" _
  42.             & " will introduce the subject."
  43.            Case 1
  44.             GetInfo = "Here you can write some statistics" _
  45.             & " about asteroids, their size, weight etc."
  46.            Case 2
  47.             GetInfo = "Here you see the NewLine in action; we use it to" _
  48.             & " create, what else, a new line; rather than wrapping" _
  49.             & " the text." & NewLine & NewLine _
  50.             & "Question: What's the name of the oldest known asteroid?" & NewLine _
  51.             & NewLine _
  52.             & "Answer: Rip Van Twinkle."
  53.          End Select
  54.          Exit Function  ' we got what we wanted
  55.     Case 1 '"earth"
  56.       GetInfo = "Write small blurb about earth here."
  57.     Case 2 '"jupiter"
  58.       GetInfo = "Write small blurb about jupiter here."
  59.     Case 3 '"mars"
  60.       GetInfo = "Write small blurb about mars here."
  61.     Case 4 '"mercury"
  62.       GetInfo = "Write small blurb about mercury here."
  63.     Case 5 ' "meteor"
  64.       GetInfo = "Write small blurb about meteors here."
  65.     Case 6 ' "neptune"
  66.       GetInfo = "Write small blurb about neptune here."
  67.     Case 7 '"pluto"
  68.       GetInfo = "Write small blurb about pluto here."
  69.     Case 8 '"saturn"
  70.       GetInfo = "Write small blurb about saturn here."
  71.     Case 9 '"space craft"
  72.       GetInfo = "Write small blurb about space craft here."
  73.     Case 10 '"sun"
  74.       GetInfo = "Write small blurb about sun here."
  75.     Case 11 '"uranus"
  76.       GetInfo = "Write small blurb about uranus here."
  77.     Case 12 '"venus"
  78.       GetInfo = "Write small blurb about venus here."
  79.     End Select
  80. End Function
  81.